package com.ulife.supplier.module.screen;

import java.sql.SQLException;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.ulife.supplier.dao.SupplierDao;
import com.ulife.supplier.dao.dataobject.SupplierDo;

/**
 * 供应商列表
 * @author Administrator
 */
public class Supplierlist {

	private static final Logger log = LoggerFactory.getLogger(Supplierlist.class);

	@Autowired
	private SupplierDao supplierDao;

	public void execute(Context context, Navigator nav) {
		context.put("module", "supplier");
		try {
			List<SupplierDo> sList = (List<SupplierDo>) context.get("supplierList");
			if (sList == null) {
				context.put("supplierList", supplierDao.queryAllSupplier());
			}
		} catch (SQLException e) {
			log.error("SupplierList error ", e);
		}
	}
}
